<?php

use yii\db\Migration;

/**
 * Handles the creation of table `package_uploaded_excel`.
 */
class m170919_091656_create_package_uploaded_excel_table extends Migration
{
    /**
     * @inheritdoc
     * 资产包上传记录表
     */
    public function up()
    {
        $this->createTable('package_uploaded_excel', [
            'id' => $this->bigPrimaryKey(),
            'file_name' => $this->string()->notNull()->comment('文件名称'),
            'file_save_name' => $this->string()->notNull()->comment('存储名称'),
            'imported' => $this->smallInteger()->notNull()->defaultValue(2)->comment('是否入库'),//1是2否
            'owner' => $this->bigInteger()->notNull()->comment('上传人'),
            'package_id' => $this->bigInteger()->notNull()->comment('资产包ID'),
            'created_at' => $this->timestamp()->notNull()->comment('上传时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('package_uploaded_excel');
    }
}
